package com.blb.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.blb.entity.User;

public interface UserMapper {

	@Select("select * from s_user u where u.username = #{userName}")
	User getUserByUserName(String userName) throws SQLException;
	
	@Insert("insert into s_user(id, username, password, sex, city, job, money, head_img)values(#{id}, #{username}, #{password}, #{sex}, #{city}, #{job}, #{money}, #{headImg})")
	void addUser(User user);
	
	List<User> getUserPage(@Param("start")int start, @Param("end")int end, @Param("username")String username, @Param("job")String job);
	
	int getCount(@Param("username")String username, @Param("job")String job);
	
	void delete(@Param("ids")String[] ids);
}
